<template>
  <div id="contractDetail">
    <el-form :model="data" label-width="100">
      <el-form-item label="合同编码:">
        <p>{{ data.contractCode }}</p>
      </el-form-item>
      <el-form-item label="客户名称:">
        <p>{{ data.customerName }}</p>
      </el-form-item>
      <el-form-item label="退款金额:">
        <p>{{ data.refundMoney }}</p>
      </el-form-item>
      <el-form-item label="退款时间:">
        <p>{{ data.createTime }}</p>
      </el-form-item>
      <el-form-item label="退货产品:" style="width: 100%">
        <el-table
          ref="table"
          row-key="id"
          :data="data.refundProducts"
          border
          :header-cell-style="{ background: '#f5f7fa' }"
        >
          <el-table-column
            label="产品名称"
            prop="name"
            min-width="100"
            :show-overflow-tooltip="true"
          ></el-table-column>
          <el-table-column
            label="规格型号"
            prop="specification"
            min-width="100"
            :show-overflow-tooltip="true"
          ></el-table-column>
          <el-table-column
            label="材质"
            prop="vproductMaterial"
            min-width="100"
            :show-overflow-tooltip="true"
          ></el-table-column>
          <el-table-column
            label="备注"
            prop="vproductRemark"
            min-width="100"
            :show-overflow-tooltip="true"
          ></el-table-column>
          <el-table-column prop="refundNum" label="退款数量" width="100">
          </el-table-column>
          <el-table-column
            label="单位"
            prop="unitName"
            width="200"
          ></el-table-column>
        </el-table>
      </el-form-item>
      <el-form-item label="备注:" style="width: 100%">
        <p>{{ data.reason }}</p>
      </el-form-item>
      <el-form-item label="退款人:">
        <p>{{ data.refundAdminName }}</p>
      </el-form-item>
      <el-form-item label="审核状态:" v-if="isReloadData">
        <!-- 0，未审核，1,审核通过，2审核未通过-->
        <p v-if="data.status == 0">待审核</p>
        <p v-if="data.status == 1" style="color: #67c23a">通过</p>
        <p v-if="data.status == 2" style="color: #f56c6c">未通过</p>
        <p v-if="data.status == 3" style="color: #ff9b31">审核中</p>
        <p v-if="data.status == 4" style="color: #f56c6c">作废</p>
        <p v-if="data.status == 5" style="color: #f56c6c">删除</p>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
export default {
  name: 'detail',
  data () {
    return {
      form: {},
      isReloadData: true//局部刷新标识
    }
  },
  props: {
    data: {
      type: Object,
      required: true
    }
  },
  methods: {
    relodPart () {
      this.isReloadData = false
      this.$nextTick(() => {
        this.isReloadData = true
      })
    }
  }

}
</script>
<style lang='scss' scoped>
</style>